{% load promgen %}
<nav aria-label="Page navigation">
    {% if page_obj.has_other_pages %}
    <ul class="pagination">
        {% if page_obj.has_previous %}
        <li><a href="?{% qs_replace 'page' page_obj.previous_page_number %}">&laquo;</a></li>
        {% else %}
        <li class="disabled"><span>&laquo;</span></li>
        {% endif %}
        {% for i in page_obj.paginator.page_range %}
        {% if page_obj.number == i %}
        <li class="active"><span>{{ i }} <span class="sr-only">(current)</span></span></li>
        {% else %}
        <li><a href="?{% qs_replace 'page' i %}">{{ i }}</a></li>
        {% endif %}
        {% endfor %}
        {% if page_obj.has_next %}
        <li><a href="?{% qs_replace 'page' page_obj.next_page_number %}">&raquo;</a></li>
        {% else %}
        <li class="disabled"><span>&raquo;</span></li>
        {% endif %}
    </ul>
    {% endif %}
</nav>
